package topday1_9.mxdx9;

/**
 * @Auther:小陈的Java
 * 静态方法使用细节
 */
public class StaticMethodDemo {
    private static int i = 1;
    public static void method1(){
        System.out.println(i);
        //System.out.println(j); 报错
        //method2(); 报错
        System.out.println("静态方法");
    }
    private int j = 1;
    public void method2(){
        System.out.println("普通方法");
        //普通方法即可以方法普通方法/属性又可以访问静态方法/属性
        System.out.println(i);
        System.out.println(j);
    }

    public static void main(String[] args) {
        StaticMethodDemo staticMethodDemo = new StaticMethodDemo();
        staticMethodDemo.method2();
    }
}